<div class="main_box"> 
 <div id="mainContent_2"> 
      <div id="coupon-items">
        <div class="submenubg"></div>
        <div class="bar"></div>
        <div class="box">
           <div class="clear tips bdbottom">
          		<p align="right"><a href="<?php echo edp_href_link(PAGENAME_COUPON_SUMMARY);?>">返回优惠券兑换列表&gt;&gt;</a></p>
         		<input type="hidden" id="couponId" value="<?php echo $coupon['coupon_id'];?>">
				<div class="iconbg"><img src="<?php echo EdpGetCouponPicUrl($coupon['coupon_picture']);?>"  width="150" /></div>
				<div class="coupon_detail">
					<h5><span id="couponName"><?php secho($coupon['coupon_name']);?></span></h5>
	<?php
					$types=explode(",",$coupon['coupon_type']);
					if(in_array("1", $types))
					{
						echo '<p>有效期：'.EdpSubStr($coupon['coupon_start_date'],0,10).'至'.EdpSubStr($coupon['coupon_end_date'],0,10).'</p>';
					}
					else
					{
						echo '<p>有效期：不限期</p>';
					}
					if(in_array("2", $types))
					{
						echo '<p>剩余数目：'.$coupon['coupon_total_num'].'</p>';
					}
					else
					{
						echo '<p>有效期：不限量</p>';
					}
	?>
					<p>交易价格：<span id="couponPrice"><?php echo $coupon['coupon_per_price'];?></span>个E币</p>
					<p>消费地址：<a href="<?php echo $coupon['coupon_url'];?>"><?php echo $coupon['coupon_url'];?></a></p>
					<a id="buyCoupon_<?php echo $coupon['coupon_id'];?>" class="buyCoupon" href="#"><img src="<?php echo IMAGE_DIR.'btn_buycoupon.gif';?>" width="117" height="37" /></a>
					&nbsp;&nbsp;
					<a href="<?php echo edp_href_link(PAGENAME_HELP, 'subpage=303');?>" target="_blank">查看帮助</a>
		    	</div>
		    	<div class="clear"></div>	    	
		    </div>
		    <p align="right"><a href="mailto:admin@dianping.com?subject=<?php echo urlencode('优惠券举报');?>">优惠券举报</a></p>
         	<div class="clear tips bdbottom">
               <div class="greybg">
               		<h3>详细信息 </h3><p><?php echo $coupon['coupon_desc'];?></p>
          	   </div>
            </div>
            
            <div class="clear tips tips2 bdbottom">
           		<h3 class="blak">兑换记录 </h3>
<?php
				 if($histories)
				 {
				 	foreach($histories as $key=>$history)
				 	{
?>
						<p>
							<a href="<?php echo edp_href_link(PAGENAME_USER_INFO, 'uid='.$history['user_id']);?>">
<?php 
							if(EdpStrLen($history['nick'])>'20')
								secho(EdpSubStr($history['nick'], 0, 20).'...');
							else 
								secho($history['nick']);
?>
							</a><span class="grey"> 
							于
							<?php echo EdpSubStr($history['coupon_exchange_date'],0,10);?>
							兑换了</span>
							<a href="<?php echo edp_href_link(PAGENAME_COUPON_INFO, 'couponID='.$coupon['coupon_id']);?>">
							<?php secho($coupon['coupon_name']);?>
							</a>
						</p>
						
<?php
	 				}
	 			}
?>
		</div>
	 <div class="clear tips tips3 ">
		<h3 class="blak">热门优惠券兑换中…… </h3>
		<div class="clear">
<?php
		if($hotCoupons)
		{
			foreach($hotCoupons as $key=>$hotcoupon)
			{
?>
				<div class="coupon2">
					
						<div class="
<?php 
				if($hotcoupon['coupon_per_price']==0)
					echo 'iconbg1';
				else 
					echo 'iconbg1_spec';
?>
						">
						<a class="pos" href="<?php echo edp_href_link(PAGENAME_COUPON_INFO, 'couponID='.$hotcoupon['coupon_id'])?>">
							<img src="<?php echo EdpGetCouponPicUrl($hotcoupon['coupon_picture']);?>" width="80" />
						</a>
						</div>
             		
             		<p class="blue"><a href="<?php echo edp_href_link(PAGENAME_COUPON_INFO, 'couponID='.$hotcoupon['coupon_id'])?>"><?php secho($hotcoupon['coupon_name']);?></a></p>
          		 </div>
<?php
			}
		} 
?>
		</div>
		<div class="tips3" align="right"><a href="<?php echo edp_href_link(PAGENAME_COUPON_SUMMARY)?>">返回优惠券列表>></a></div>
      </div>
    </div>
    
    <div class="btm">
    </div>
    </div>
    </div>

	<div id="sidebar_right">
	 	<div class="pub_coupon">
			<h3>我是商家</h3>
			<a href="<?php echo edp_href_link(PAGENAME_HELP, 'subpage=501');?>">
				<img src="<?php echo IMAGE_DIR ?>publishcoupon.png"/>
			</a>
		</div>
      
      <div class="column bdbottom2" >
	      <div class="btna solidbottom"><h4>热门礼品</h4></div>
<?php 
		  if($hotGifts)
		  {
		  	$i = 1;
		  	foreach($hotGifts as $key=>$gift)
		  	{
?>
      	<p><a <?php if( $i < 3 ) echo 'class="red"';?>  href="<?php echo edp_href_link(PAGENAME_GIFT_INFO, 'gid='. $gift['gift_id']);?>"><?php echo $gift['gift_name'];?></a></p>
<?php 	
      			$i++;
		  	}
		  }
?>
      </div>
      
      <div class="column bdbottom2" >
      	<div class=" solidbottom"><h4>最新兑换</h4></div>
<?php
		if($recenthistories)
		{
			foreach($recenthistories as $key=>$history)
			{
?>
			<p><a href="<?php echo edp_href_link(PAGENAME_USER_INFO, 'uid='.$history['user_id']);?>"><?php echo $history['nick'];?></a>
			<span class="blak">兑换了</span>
<?php
			if($history['coupon_status']==1)
		    { 
?>
			<a href="<?php echo edp_href_link(PAGENAME_COUPON_INFO, 'couponID='.$history['coupon_id']);?>">
<?php
			} 
			if(EdpStrLen($history['coupon_name'])>10)
				echo EdpSubStr($history['coupon_name'],0,10).'...';
			else
				echo $history['coupon_name'];
			if($history['coupon_status']==1)
		    { 
?>
			</a>
<?php
			} 
?>	
			。<span class="grey"><?php echo $history['timediff'];?>
			</span></p>
<?php
			} 
		}
		
?>
		</div>
	</div>
</div>
	<div id="PopBox" style="display:none;cursor:default;" class="popup"></div>

	